<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 父类
        class Parent {
            consttuctor(name, age, sex) {
                this.name = name;
                this.age = age;
                this.sex = sex;
            }
            say() {
                console.log('this is say');
            }
        }

        // 子类
        class Son extends Parent {
            constructor(name, age, sex, hobby) {
                // 构造函数继承的: super
                super(name, age, sex);
                this.hobby = hobby;
            }
            show() {
                console.log('this is show');
            }
        }
        let xiaoming = new Son('小明', 20, 'nan', '画画');
        console.log(xiaoming)
    </script>
</body>
</html>